import http from '@/utils/request.js'

export default {
    add: {
        name: '添加新角色',
        url: `${import.meta.env.VITE_API_URL}/role/add`,
        async post(data) {
            return await http.post(this.url, data)
        },
        async get(data) {
            return await http.get(this.url, data)
        }
    },
    update: {
        name: '更新角色',
        url: `${import.meta.env.VITE_API_URL}/role/update`,
        async post(data) {
            return await http.post(this.url, data)
        },
        async get(data) {
            return await http.get(this.url, data)
        }
    },
    list: {
        name: '获取角色列表',
        url: `${import.meta.env.VITE_API_URL}/role/list`,
        async post(data) {
            return await http.post(this.url, data)
        },
        async get(data) {
            return await http.get(this.url, data)
        }
    },

    details: {
        name: '获取角色详情',
        url: `${import.meta.env.VITE_API_URL}/role/details`,
        async post(data) {
            return await http.post(this.url, data)
        },
        async get(data) {
            return await http.get(this.url, data)
        }
    },
    delete: {
        name: '删除角色项',
        url: `${import.meta.env.VITE_API_URL}/role/delete`,
        async post(data) {
            return await http.post(this.url, data)
        },
        async get(data) {
            return await http.get(this.url, data)
        }
    }
}
